<template>
	<view class="warp">
		<rich-text :nodes="str"></rich-text>
	</view>
</template>

<script>
	const db = uniCloud.database();
	import {
		useUserStore
	} from "@/pinia/user.js"
	import {
		mapState
	} from "pinia"
	export default {
		data() {
			return {
				id: '',
				title: '用户服务协议',
				str: ''
			}
		},
		computed: {
			...mapState(useUserStore, ['sysSetting']),
		},
		onLoad(op) {
			console.log("op", op)
			if (op.id) {
				this.id = op.id
				this.str = this.sysSetting.serviceAgreements
				this.title = "用户服务协议"
				
				if (this.id == 'privacy') {
					this.str = this.sysSetting.privacyAgreements
					this.title = "隐私政策条款"
				}
			}
		},
		onReady() {
			if (this.title) {
				uni.setNavigationBarTitle({
					title: this.title
				});
			}
		},
		methods: {}
	}
</script>

<style scoped lang="scss">
	.warp {
		padding: 10px;
	}
</style>